package com.sdp.wx.db.wx_wz_procured_detail.service.impl;

import com.sdp.wx.db.wx_wz_procured_detail.entity.WxWzProcuredDetail;
import com.sdp.wx.db.wx_wz_procured_detail.mapper.WxWzProcuredDetailMapper;
import com.sdp.wx.db.wx_wz_procured_detail.service.IWxWzProcuredDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-01-20
 */
@Service
public class WxWzProcuredDetailServiceImpl extends ServiceImpl<WxWzProcuredDetailMapper, WxWzProcuredDetail> implements IWxWzProcuredDetailService {

	@Override
	public List<WxWzProcuredDetail> queryWxWzProcuredDetailByPlanCode(String planCode) {
		LambdaQueryWrapper<WxWzProcuredDetail> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxWzProcuredDetail::getPlanCode, planCode);
		return list(queryWrapper);
	}

	@Override
	public void removeWxWzProcuredDetailByPlanCode(String planCode) {
		LambdaQueryWrapper<WxWzProcuredDetail> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxWzProcuredDetail::getPlanCode, planCode);
		remove(queryWrapper);
		
	}

	@Override
	public List<WxWzProcuredDetail> queryCanArrivalWzProcuredDetailByPlanCode(String planCode) {
		LambdaQueryWrapper<WxWzProcuredDetail> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxWzProcuredDetail::getPlanCode, planCode);
		queryWrapper.gt(WxWzProcuredDetail::getNotArrivalNum,BigDecimal.ZERO);
		return list(queryWrapper);
	}

}
